import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.FileNotFoundException;
import java.io.IOException;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class gestorGuide extends javax.swing.JFrame {
	private JLabel jLabel1;
	private JLabel jLabel2;
	private JLabel jLabel3;
	private JLabel jLabel4;
	private JButton saldo;
	private JButton acttar;
	private JButton cartar;
	private Gestor tempges = new Gestor();

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				gestorGuide inst = new gestorGuide();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public gestorGuide() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			{
				jLabel1 = new JLabel();
				getContentPane().add(jLabel1);
				jLabel1.setText("TransWampi");
				jLabel1.setBounds(150, 37, 115, 16);
			}
			{
				jLabel2 = new JLabel();
				getContentPane().add(jLabel2);
				jLabel2.setText("Cargar Tarjeta:");
				jLabel2.setBounds(70, 86, 92, 16);
			}
			{
				jLabel3 = new JLabel();
				getContentPane().add(jLabel3);
				jLabel3.setText("Activar Tarjeta:");
				jLabel3.setBounds(70, 138, 101, 16);
			}
			{
				cartar = new JButton();
				getContentPane().add(cartar);
				cartar.setText("OK");
				cartar.setBounds(247, 80, 68, 29);
				cartar.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						try {
							cartarMouseClicked(evt);
						} catch (FileNotFoundException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						} catch (IOException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						} catch (ClassNotFoundException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
				});
			}
			{
				acttar = new JButton();
				getContentPane().add(acttar);
				acttar.setText("OK");
				acttar.setBounds(247, 132, 68, 29);
				acttar.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						try {
							acttarMouseClicked(evt);
						} catch (FileNotFoundException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						} catch (IOException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						} catch (ClassNotFoundException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
				});
			}
			{
				jLabel4 = new JLabel();
				getContentPane().add(jLabel4);
				jLabel4.setText("Mostrar Saldo:");
				jLabel4.setBounds(70, 183, 112, 16);
			}
			{
				saldo = new JButton();
				getContentPane().add(saldo);
				saldo.setText("OK");
				saldo.setBounds(247, 179, 68, 30);
				saldo.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						try {
							saldoMouseClicked(evt);
						} catch (FileNotFoundException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						} catch (IOException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						} catch (ClassNotFoundException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
				});
			}
			pack();
			setSize(400, 300);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private void cartarMouseClicked(MouseEvent evt) throws FileNotFoundException, IOException, ClassNotFoundException {
		System.out.println("cartar.mouseClicked, event="+evt);
		cargarGuide temp = new cargarGuide();
		temp.show();
	}
	
	private void acttarMouseClicked(MouseEvent evt) throws FileNotFoundException, IOException, ClassNotFoundException {
		System.out.println("acttar.mouseClicked, event="+evt);
		tempges.activarTarjeta();
	}
	
	private void saldoMouseClicked(MouseEvent evt) throws FileNotFoundException, IOException, ClassNotFoundException {
		System.out.println("saldo.mouseClicked, event="+evt);
		tempges.mostrarSaldo();
	}

}
